Skip to content

FreeBSD crc32 cap detection for arm64 #4922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

devnexen
Copy link
Member

No description provided.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

# if defined(HWCAP_CRC32)
zend_long crc32 = 0;
if (elf_aux_info(AT_HWCAP, &crc32, sizeof(crc32)) == 0)
res = crc32 & HWCAP_CRC32;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

res isn't returned here. This will only work on the second run.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I forgot about this one but a lot had changed since and it s an useless change now, FreeBSD uses a wrapper to be closer to Linux.

# endif

static inline int has_crc32_insn() {
/* Only go through the runtime detection once. */
static int res = -1;
if (res != -1)
return res;
# if defined(__linux__)
# if defined(HWCAP_CRC32)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Should be indented.

@devnexen devnexen closed this Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants